package cn.bocai.pc.dao.imp;

import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import cn.bocai.pc.dao.BcUserMapper;
import cn.bocai.pc.model.BcUser;
@Repository
public class BcUserMapperImpl extends SqlSessionDaoSupport implements BcUserMapper {
	String ns="cn.bocai.pc.dao.BcUserMapper.";
	
	//ajax查询注册的时候用户名是否存在
	public BcUser selectNameExist(String name){
		BcUser bc_user = (BcUser)this.getSqlSession().selectOne(ns+"selectNameExist",name);
		 return bc_user;
		}
	
	//保存用户注册信息
	public int insertRegister(BcUser record) {
		int insert = this.getSqlSession().insert(ns+"insertRegister", record);
		System.out.println("insertRegister="+insert);
		return insert;
	}
	
	//用户登入查询登入信息
	public BcUser selectLogin(BcUser record) {
		BcUser bc_login =(BcUser)this.getSqlSession().selectOne(ns+"selectLogin",record);
		return bc_login;
	}
    //登入以后修改用户密码
	public int updateUserPaw(Map<String, Object> par) {
		int updDate = this.getSqlSession().update(ns+"updateUserPaw",par);
		return updDate;
	}
	
	//注册时查询邮箱是否存在
	public BcUser selectEmail(String email) {
		BcUser bc_eamil =(BcUser)this.getSqlSession().selectOne(ns+"selectEmail",email);
		return bc_eamil;
	}
	
	public int deleteByPrimaryKey(String userId) {
		// TODO Auto-generated method stub
		return 0;
	}

	

	public int insertSelective(BcUser record) {
		// TODO Auto-generated method stub
		return 0;
	}

	public BcUser selectByPrimaryKey(String userId) {
		// TODO Auto-generated method stub
		return null;
	}

	public int updateByPrimaryKeySelective(BcUser record) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int updateByPrimaryKey(BcUser record) {
		// TODO Auto-generated method stub
		return 0;
	}

	

	

	


}
